package arithmetic1.test1;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class E {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int num1=Integer.parseInt(scanner.nextLine());
        String str=scanner.nextLine();
        int num2=Integer.parseInt(scanner.nextLine());
        scanner.close();
        String strs[]=str.split("[ ]");
        if(num1!=strs.length){
            throw new RuntimeException("输入个数不正确");
        }
        List<String> list=new ArrayList<>();
        for(String s:strs){
            if(!s.equals(num2+"")){
                list.add(s);
            }
        }
        for(String s:list){
            System.out.print(s+" ");
        }
    }
}
